<template>
	<view class="addInspectTabsContent">
		<view class="upper">
			<commonNavBar title="新增检查" :showRobot="true"></commonNavBar>
			<view class="step">
				<view v-for="(tabs,index) in stepList" :key="index" @tap="stepActive(index)">
					<view :class="{'active':tabs.active}">
						{{ tabs.step }}
					</view>
				</view>
			</view>
		</view>
		<view class="centre">
			<view class="content-container">
				<view class="addInspect" v-show="stepList[0].active">
					<view class="map">
						<image src="@/static/img/mapActive.png" />
						<text @tap="companyDimension(addInspectData.lngLat)"
							v-text="isLocationPoint(addInspectData.lngLat) ? '主体已标注':'主体未标注，请进行主体标注【点击开始主体标注】'"></text>
					</view>
					<view class="content">
						<view class="one">
							<view class="title">
								<view class="left">监管单位信息</view>
							</view>
							<view class="box">
								<view class="text">监管单位：<text>{{ addInspectData.superviseDeptName }}</text>
								</view>
								<view class="text">
									检查时间：<text>{{ addInspectData.checkTime ==  undefined ?  inspectTime : addInspectData.checkTime }}</text>
								</view>
								<view class="text">执法人员1：
									<uni-data-select v-model="addInspectData.checkPerson1Id" :localdata="userList"
										:clear="false" :placeholder="'请选择执法人员'"></uni-data-select>
								</view>
								<view class="text">执法人员2：
									<uni-data-select v-model="addInspectData.checkPerson2Id" :localdata="userList"
										:clear="false" :placeholder="'请选择执法人员'"></uni-data-select>
								</view>
							</view>
						</view>
						<view class="two">
							<view class="title">
								<view class="left">生产经营主体信息</view>
							</view>
							<view class="box">
								<view class="text">
									主体名称：
									<text>{{ addInspectData.companyName  }}</text>
								</view>
								<view class="text">
									经营地址：
									<view
										style="width: 560rpx;text-overflow: ellipsis; white-space: nowrap;overflow: hidden;">
										<text>{{ addInspectData.companyAddress }}</text>
									</view>
								</view>
								<view class="text">
									主体类别：
									<text>{{ addInspectData.companyTypeName }}</text>
								</view>
								<view class="text">
									{{ addInspectData.supProcess == 'spxs' || addInspectData.supProcess == 'cyfw' ? '经营范围' : '品种明细' }}：
									<text>{{ addInspectData.companyNatureBusiness }}</text>
								</view>
								<view class="text">负责人：<text>{{ addInspectData.companyContact }}</text>
								</view>
								<view class="text">
									联系方式：
									<view class="input-container">
										<input type="number" placeholder="请输入联系方式"
											v-model="addInspectData.companyContactPhone"
											placeholder-class="placeholder-class" />
									</view>
								</view>
							</view>

						</view>

					</view>
				</view>
				<view class="addInspectContent" v-show="stepList[1].active">
					<view class="positioning">
						<image src="@/static/img/mapActiveTwo.png" />
						<text @tap="companyDimension(addInspectData.lngLat)"
							v-text="isLocationPoint(addInspectData.lngLat) ? '主体已标注':'主体未标注，请进行主体标注【点击开始主体标注】'"></text>
					</view>
					<view class="box">
						<view class="manage_status_box"
							v-if="addInspectData.supProcess == 'spsc' || addInspectData.supProcess == 'tssc'">
							<text class="manage_status_title">生产状态：</text>
							<radio-group @change="businessStatusRadioChange" class="custom-radio-group">
								<label class="labelRadio" :class="{'yes': addInspectData.manageStatus === '0'  }">
									<radio value="0" :checked="addInspectData.manageStatus ==='0'" />
									在产
								</label>
								<label class="labelRadio" :class="{ 'no': (addInspectData.manageStatus === '1' ) }  ">
									<radio value="1" :checked="addInspectData.manageStatus === '1'" />
									长期停产
								</label>
							</radio-group>
						</view>
						<view class="manage_status_box" v-else>
							<text class="manage_status_title">经营状态：</text>
							<radio-group @change="businessStatusRadioChange" class="custom-radio-group">
								<label class="labelRadio" :class="{'yes': addInspectData.manageStatus === '0'  }">
									<radio value="0" :checked="addInspectData.manageStatus ==='0'" />
									正常
								</label>
								<label class="labelRadio" :class="{ 'no': (addInspectData.manageStatus === '1' ) }  ">
									<radio value="1" :checked="addInspectData.manageStatus === '1'" />
									异常
								</label>
							</radio-group>
						</view>
						<view class="abnormal"
							v-show="addInspectData.manageStatus === '1'  && (addInspectData.supProcess == 'spxs' || addInspectData.supProcess == 'cyfw') ">
							<view class="block">
								<view class="text">
									异常核查记录：
									<uni-data-select v-model="addInspectData.abnormalVerificationRecord"
										:localdata="abnormalCauseList" :clear="false"></uni-data-select>
								</view>
								<!-- <view class="text">
									异常原因：
									<uni-data-select v-model="addInspectData.abnormalCause" :localdata="abnormalCauseList"
										  :clear="false"></uni-data-select>
								</view>
								<view class="text">
									异常情况核查记录：
									<input type="text" placeholder="必填项" v-model="addInspectData.abnormalVerificationRecord"
										placeholder-class="placeholder-class" />
								</view> -->
								<view class="text">
									整改时间：

									<picker mode="date" @change="rectificationTimeClick">
										<view style="width: 500rpx;height:30rpx ">
											<text style="font-size: 19rpx;">
												{{ (addInspectData.rectificationTimeLimit == 'undefined' || addInspectData.rectificationTimeLimit == undefined) ? '请选择时间' : addInspectData.rectificationTimeLimit}}
											</text>
										</view>
									</picker>
								</view>
								<view class="text">
									检查结果：
									<view class="div">
										<text>重点项发现问题（{{totalEmphasisNum}}）项</text>
										<text>一般项发现问题（{{totalGeneralNum}}）项</text>
									</view>
								</view>
								<view class="text">
									处理结果：
									<text>责令整改</text>
								</view>
							</view>
						</view>
						<view class="three" v-show="addInspectData.manageStatus != '1'">
							<view class="box">
								<!-- <view class="text facadePhoto">
									门脸照片：
									<image  style="width:100px;height:100px;border:1px solid #e8e8e8;border-radius: 7px;"  @tap="facadePhotoControl(addInspectData.comanyPic)"  
									:src="addInspectData.comanyPic == undefined ? '/static/img/upload.png': baseUrl + addInspectData.comanyPic"   ></image>
								</view> -->
								<view class="text facadePhoto">
									告知页 &nbsp;&nbsp;&nbsp;&nbsp;：
									<image style="width:100px;height:100px;border:1px solid #e8e8e8;border-radius: 7px;"
										@tap="showNoticeControl(addInspectData.informUrl)"
										:src="addInspectData.informUrl == undefined ? '/static/img/upload.png': baseUrl + addInspectData.informUrl ">
									</image>
								</view>
							</view>
						</view>
						<view class="dt">
							<view class="h1">食品销售日常监督检查要点表</view>
							<view class="div">
								<view class="left">食品通用检查项目：</view>
								<view class="right">
									<view>重点发现问题<text>（{{emphasisNum}}）</text>项</view>
									<view>一般发现问题<text>（{{generalNum}}）</text>项</view>
								</view>
							</view>
							<view class="div">
								<view class="left">检查结果：</view>
								<radio-group v-model="addInspectData.checkResult" @change="accordRadioChange"
									class="custom-radio-group">
									<label class="labelRadio" :class="{'yes': addInspectData.checkResult == '符合'}">
										<radio value="符合" :disabled="hasContentSelect2Or3" />
										符合
									</label>

									<label class="labelRadio" :class="{'no': addInspectData.checkResult == '基本符合'}">
										<radio value="基本符合" />
										基本符合
									</label>
									<label class="labelRadio" :class="{'no': addInspectData.checkResult == '不符合'}">
										<radio value="不符合" />
										不符合
									</label>
									<label class="labelRadio" :class="{'no': addInspectData.checkResult == '其他'}">
										<radio value="其他" />
										其他
									</label>
								</radio-group>
							</view>
							<view class="div">
								<view class="left">处理结果：</view>
								<radio-group @change="handleRadioChange" class="custom-radio-group">
									<label class="labelRadio" :class="{'yes': (addInspectData.processResults === '1')}">
										<radio value="1" :disabled="checkResultStatus == '1'"
											:checked="addInspectData.processResults === '1'" />
										通过检查
									</label>
									<label class="labelRadio" :class="{'no': (addInspectData.processResults === '2')}">
										<radio value="2" :disabled="checkResultStatus == '2'"
											:checked="addInspectData.processResults === '2'" />
										责令整改
									</label>
									<label class="labelRadio" :class="{'no': (addInspectData.processResults === '3')}">
										<radio value="3" :disabled="checkResultStatus == '2'"
											:checked="addInspectData.processResults === '3'" />
										调查处理
									</label>
								</radio-group>
							</view>
							<view class="div"
								v-show="addInspectData.processResults === '2' || addInspectData.processResults === '3' ">
								<view class="left">整改时间：</view>
								<view class="right" style="width:  70%;">
									<picker mode="date" @change="rectificationTimeClick">
										<view style="width: 600rpx;height:30rpx ">
											<text style="font-size: 19rpx;">
												{{ (addInspectData.rectificationTimeLimit == 'undefined' || addInspectData.rectificationTimeLimit == undefined) ? '请选择时间' : addInspectData.rectificationTimeLimit}}
											</text>
										</view>
									</picker>
								</view>
							</view>
							<view class="div">
								<view class="left">其他需要记录的问题：</view>
								<view class="right">
									<view class="input-container">
										<input type="text" placeholder="请输入" v-model="addInspectData.otherProblem"
											placeholder-class="placeholder-class" />
									</view>
								</view>
							</view>
						</view>
						<view class="dd" style="padding-bottom: 50px;"
							v-for="(item, index) in addInspectData.standardList" :key="index">
							<view class="h1">
								{{ item.serialNum }}. {{ item.name }}
							</view>
							<view class="block">
								<view class="li"
									:class="{'float-border' : selectedContent == 'content' + index + ':' + dataIndex  ? true :false }"
									@tap="contentSelectedStatus(index,dataIndex)"
									v-for="(data,dataIndex) in item.contentList" :key="dataIndex">
									<view class="titles">
										<view class="titles-left">
											<text><text :class="{'text-red' : data.riskCount > 0 }"
													v-show="data.importentItem === '2'">*</text></text>
											<view class="text" :class="{'text-red' : data.riskCount > 0 }">
												{{item.serialNum}}.{{data.serialNum}}&nbsp;&nbsp;{{ data.checkContent }}
											</view>
										</view>
										<!-- 是否显示检查指南(不知道pc在哪配置  暂时先全放开了) v-if="data.GUIDE_PRE === '1'" -->
										<view class="titles-right">
											<view class="guide"
												v-if="checkExist(data.checkBasis,data.checkGuide,data.checkMethod,data.checkProblem)"
												@tap="inspectionGuidelines(data.checkBasis,data.checkGuide,data.checkMethod,data.checkProblem)">
												<image src="/static/img/questionMark.png" mode=""></image>
												检查指南
												<!-- <view class="triangle"></view> -->
											</view>
											<!-- <view class="guide" v-if="data.riskCount > 0"  @tap="showRiskContent(data.contentId)">
												<image src="/static/img/questionMark.png" mode=""></image>
												风险提示 
											</view> -->
										</view>
									</view>
									<view class="optionList">
										<view class="list">
											<view class="option" :class="{ 'active':  data.selection == 1   }"
												@tap="switchSelection(index,dataIndex,1)">
												是
											</view>
											<view class="option" :class="{ 'active':    data.selection == 2    }"
												@tap="switchSelection(index,dataIndex,2)">
												否
											</view>
											<view class="option"
												v-if="data.missingItem === '1' || addInspectData.supProcess == 'spsc' || addInspectData.supProcess == 'tssc' "
												:class="{ 'active':   data.selection == 3    }"
												@tap="switchSelection(index, dataIndex,3)">
												合理缺项
											</view>
										</view>
										<view class="case">
											<view v-if="data.selection == 2 ">
												<view class="h2">问题描述 ：</view>
												<view class="no-realy-content">
													<uni-data-select :value="data.problemContent"
														:localdata="problemDescriptionList"
														@change="problemDescriptionChange($event, index, dataIndex,item.templateId,item.id,data.id,2)"
														:clear="false"></uni-data-select>
													<view class="content-upload-btn"
														v-if="data.problemFile == undefined && data.selection == 2 "
														@tap="uploadContentFile(index,dataIndex,item.id,data.id)">上传文件
													</view>
													<view class="content-upload-btn-realy"
														v-if="data.problemFile != undefined"
														@tap="showContentFileControls(index,dataIndex,item.id,data.id, data.problemFile)">
														点击查看</view>
												</view>

												<textarea maxlength="2000" class="problem" placeholder="请输入备注"
													v-model="data.problemContentInput"
													placeholder-class="placeholder-class"
													v-if="data.problemContent == '自定义备注'" />
											</view>
											<view v-if="data.selection == 3">
												<view class="h2">检查说明：</view>
												<uni-data-select :value="data.missingItemContent"
													:localdata="inspectionInstructionsList"
													@change="inspectionInstructionsChange($event, index, dataIndex,item.templateId,item.id,data.id,3)"
													:clear="false"></uni-data-select>
												<textarea maxlength="2000" class="problem" placeholder="请输入备注信息"
													v-model="data.missingItemContentInput"
													placeholder-class="placeholder-class-inspect"
													v-if="data.missingItemContent == '自定义备注'" />
											</view>
										</view>
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="addInspectTrisk" v-show="stepList[2].active">
					<view class="positioning">
						<image src="@/static/img/mapActiveTwo.png" />
						<text @tap="companyDimension(addInspectData.lngLat)"
							v-text="  isLocationPoint(addInspectData.lngLat) ? '主体已标注':'主体未标注，请进行主体标注【点击开始主体标注】'"></text>
					</view>
					<view class="box">
						<view class="div">
							<view class="titles">主体资格</view>
							<view class="state">
								<view class="yes" v-if="riskWarningData.subjectQualification === '0'">
									未发现
								</view>
								<view class="no" v-else>
									有风险
									<image src="/static/img/no.png"></image>
								</view>
							</view>
							<view class="details">
								<text v-if="riskWarningData.subjectQualification === '0'">-</text>
								<text v-else @tap="addInspectriskLook(0)">详情</text>
							</view>
						</view>
						<view class="div">
							<view class="titles">主体标注</view>
							<view class="state">
								<view class="yes" v-if="riskWarningData.bodyCallouts === '0'">
									未发现
								</view>
								<view class="no" v-else>
									有风险
									<image src="/static/img/no.png"></image>
								</view>
							</view>
							<view class="details">
								<text v-if="riskWarningData.bodyCallouts === '0'">-</text>
								<text v-else @tap="addInspectriskLook(1)">详情</text>
							</view>
						</view>
						<view class="div">
							<view class="titles">抽检信息</view>
							<view class="state">
								<view class="yes" v-if="riskWarningData.foodSafe === '0'">
									未发现
								</view>
								<view class="no" v-else>
									有风险
									<image src="/static/img/no.png"></image>
								</view>
							</view>
							<view class="details">
								<text v-if="riskWarningData.foodSafe === '0'">-</text>
								<text v-else @tap="addInspectriskLook(2)">详情</text>
							</view>
						</view>
						<view class="div">
							<view class="titles">处罚信息</view>
							<view class="state">
								<view class="yes" v-if="riskWarningData.punishInfo === '0'">
									未发现
								</view>
								<view class="no" v-else>
									有风险
									<image src="/static/img/no.png"></image>
								</view>
							</view>
							<view class="details">
								<text v-if="riskWarningData.punishInfo === '0'">-</text>
								<text v-else @tap="addInspectriskLook(3)">详情</text>
							</view>
						</view>
						<view class="div">
							<view class="titles">投诉举报</view>
							<view class="state">
								<view class="yes" v-if="riskWarningData.complaintsReport === '0'">
									未发现
								</view>
								<view class="no" v-else>
									有风险
									<image src="/static/img/no.png"></image>
								</view>
							</view>
							<view class="details">
								<text v-if="riskWarningData.complaintsReport === '0'">-</text>
								<text v-else @tap="addInspectriskLook(4)">详情</text>
							</view>
						</view>
						<view class="div">
							<view class="titles">舆情风险</view>
							<view class="state">
								<view class="yes" v-if="riskWarningData.opinionRisk === '0'">
									未发现
								</view>
								<view class="no" v-else>
									有风险
									<image src="/static/img/no.png"></image>
								</view>
							</view>
							<view class="details">
								<text v-if="riskWarningData.opinionRisk === '0'">-</text>
								<text v-else @tap="addInspectriskLook(5)">详情</text>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="fixed">
				<button class="determine" @tap="savePopup('2')">提交</button>
				<button class="cancellation" @tap="savePopup('1')">临时保存</button>
			</view>
		</view>
		<!-- 基础信息-告知单 -->
		<uni-popup ref="noticeForm" type="bottom">
			<view class="noticeFormPopupContent">
				<view class="title">电子告知单</view>
				<view class="h1Title">食品销售经营日常监督检查</view>
				<view class="h2Ttitle">告知页</view>
				<view class="box">
					<view class="div">
						<view class="titles">被检查单位：</view>
						<text class="value">{{addInspectData.companyName}}</text>
					</view>
					<view class="div">
						<view class="titles">地址：</view>
						<text class="value">{{addInspectData.companyAddress}}</text>
					</view>
					<view class="div">
						<view class="titles">
							执法人员1：
							<!-- <text>执法证件编号：</text> -->
						</view>
						<uni-data-select v-model="addInspectData.checkPerson1Id" :localdata="userList" :clear="false"
							:placeholder="'请选择执法人员'"></uni-data-select>
					</view>
					<view class="div">
						<view class="titles">
							执法人员2：
							<!-- <text>执法证件编号：</text> -->
						</view>
						<uni-data-select v-model="addInspectData.checkPerson2Id" :localdata="userList" :clear="false"
							:placeholder="'请选择执法人员'"></uni-data-select>
					</view>
					<view class="div">
						<view class="titles">检查时间：</view>
						<text
							class="value">{{addInspectData.checkTime ==  undefined ?  inspectTime : addInspectData.checkTime }}</text>
					</view>
					<view class="div">
						<view class="titles">检查地点：</view>
						<text class="value">{{ addInspectData.companyAddress }}</text>
					</view>
					<view class="div">
						<view class="titles">告知事项：</view>
						<view class="textarea">{{notificationText | notificationFilter(this)}}</view>
					</view>
					<view class="div">
						<view class="titles">
							问：你（单位）
							<text>是否申请回避？</text>
						</view>
						<uni-data-select v-model="applyForAvoidanceValue" :localdata="applyForAvoidanceList"
							:clear="false" :placeholder="'请选择是否回避'"></uni-data-select>
					</view>
					<view class="div">
						<view class="titles">被检查单位签字：</view>
						<view @tap="signatureOne()">点击签字</view>
						<image class="sig-image" v-if="sigOnePic != ''" :src="sigOnePic"></image>
					</view>
					<view class="div">
						<view class="titles">
							执法人员1：
							<!-- <text>执法证件编号：</text> -->
						</view>
						<view @tap="signatureTwo(index)">点击签字</view>
						<image class="sig-image" v-if="sigTwoPic != ''" :src="sigTwoPic"></image>
					</view>
					<view class="div">
						<view class="titles">
							执法人员2：
							<!-- <text>执法证件编号：</text> -->
						</view>
						<view @tap="signatureThree(index)">点击签字</view>
						<image class="sig-image" v-if="sigThreePic != ''" :src="sigThreePic"></image>
					</view>
				</view>
				<view class="button">
					<button class="determine" @tap="noticeFormDetermine">保存</button>
					<button class="cancellation" @tap="noticeFormCancellation">预览</button>
				</view>
			</view>
		</uni-popup>
		<!-- 任务管理按提示 -->
		<uni-popup ref="taskAssociation" type="bottom">
			<view class="taskAssociationContent">
				<view class="title">任务关联提示</view>
				<view class="box">
					<view class="dd" v-for="(item, index) in taskAssociationList" :key="item.id">
						<view class="subscript">{{ index+1 }}</view>
						<view>{{ item.title }}</view>
						<label for="">
							<checkbox @tap="taskAssociationChange(item)"></checkbox>
							关联合并
						</label>
					</view>
					<view class="dt">
						*勾选需要关联合并检查任务，提示本次检查
					</view>
				</view>
				<view class="button">
					<button class="determine" @tap="taskAssociationDetermine">任务关联提示</button>
					<button class="cancellation" @tap="taskAssociationCancellation">不关联</button>
				</view>
			</view>
		</uni-popup>
		<!-- 基础信息-风险提示 -->
		<uni-popup ref="riskWarningPopup" type="bottom" :mask-click="false">
			<view class="riskWarningPopupContent">
				<view class="title">风险提示</view>
				<view class="box">
					<view class="div">
						<view class="titles">主体资格</view>
						<view class="state">
							<view class="yes" v-if="riskWarningData.subjectQualification === '0'">
								未发现
							</view>
							<view class="no" v-else>
								有风险
								<image src="/static/img/no.png"></image>
							</view>
						</view>
						<view class="details">
							<text v-if="riskWarningData.subjectQualification === '0'">-</text>
							<text v-else @tap="addInspectriskLook(0)">详情</text>
						</view>
					</view>
					<view class="div">
						<view class="titles">主体标注</view>
						<view class="state">
							<view class="yes" v-if="riskWarningData.bodyCallouts === '0'">
								未发现
							</view>
							<view class="no" v-else>
								有风险
								<image src="/static/img/no.png"></image>
							</view>
						</view>
						<view class="details">
							<text v-if="riskWarningData.bodyCallouts === '0'">-</text>
							<text v-else @tap="addInspectriskLook(1)">详情</text>
						</view>
					</view>
					<view class="div">
						<view class="titles">抽检信息</view>
						<view class="state">
							<view class="yes" v-if="riskWarningData.foodSafe === '0'">
								未发现
							</view>
							<view class="no" v-else>
								有风险
								<image src="/static/img/no.png"></image>
							</view>
						</view>
						<view class="details">
							<text v-if="riskWarningData.foodSafe === '0'">-</text>
							<text v-else @tap="addInspectriskLook(2)">详情</text>
						</view>
					</view>
					<view class="div">
						<view class="titles">处罚信息</view>
						<view class="state">
							<view class="yes" v-if="riskWarningData.punishInfo === '0'">
								未发现
							</view>
							<view class="no" v-else>
								有风险
								<image src="/static/img/no.png"></image>
							</view>
						</view>
						<view class="details">
							<text v-if="riskWarningData.punishInfo === '0'">-</text>
							<text v-else @tap="addInspectriskLook(3)">详情</text>
						</view>
					</view>
					<view class="div">
						<view class="titles">投诉举报</view>
						<view class="state">
							<view class="yes" v-if="riskWarningData.complaintsReport === '0'">
								未发现
							</view>
							<view class="no" v-else>
								有风险
								<image src="/static/img/no.png"></image>
							</view>
						</view>
						<view class="details">
							<text v-if="riskWarningData.complaintsReport === '0'">-</text>
							<text v-else @tap="addInspectriskLook(4)">详情</text>
						</view>
					</view>
					<view class="div">
						<view class="titles">舆情风险</view>
						<view class="state">
							<view class="yes" v-if="riskWarningData.opinionRisk === '0'">
								未发现
							</view>
							<view class="no" v-else>
								有风险
								<image src="/static/img/no.png"></image>
							</view>
						</view>
						<view class="details">
							<text v-if="riskWarningData.opinionRisk === '0'">-</text>
							<text v-else @tap="addInspectriskLook(5)">详情</text>
						</view>
					</view>
					<view class="buttonBg">
						<button class="determine" @tap="IAlreadyKnow">我已知晓</button>
					</view>
				</view>
			</view>
		</uni-popup>
		<!-- 风险提示-查看详情 -->
		<uni-popup ref="riskReminderDetails" type="bottom">
			<view class="riskReminderDetailsContent">
				<view class="title">风险提示</view>
				<view class="box">
					<view class="illustrate">
						<view class="content" v-for="(item, index) in addInspectriskLookData" :key="index">
							{{ item.text }}
						</view>
					</view>
				</view>
				<view class="closeReturn" @tap="riskReminderDetailsClose">返回</view>
			</view>
		</uni-popup>
		<!-- 检查项可能存在的风险 -->
		<uni-popup ref="riskTypePopup" type="bottom">
			<view class="inspectionGuidelinesContent">
				<view class="title">可能存在风险</view>
				<view class="box">
					<view class="div" v-for="(item,index) in checkContentRiskList">
						<view class="titles">
							{{index+1}}.
						</view>
						<view class="contents">
							{{item.TYPE_NAME}}
						</view>
					</view>
					<view class="closeReturn" @tap="riskTypePopupClose">关闭</view>
				</view>
			</view>
		</uni-popup>
		<!-- 检查指南 -->
		<uni-popup ref="inspectionGuidelines" type="bottom">
			<view class="inspectionGuidelinesContent">
				<view class="title">检查指南</view>
				<view class="box">
					<view class="div">
						<view class="titles">
							检查依据
						</view>
						<view class="contents">
							{{checkBasis}}
						</view>
					</view>
					<view class="div">
						<view class="titles">
							检查方式
						</view>
						<view class="contents">
							{{checkGuide}}
						</view>
					</view>
					<view class="div">
						<view class="titles">
							检查指南
						</view>
						<view class="contents">
							{{checkMethod}}
						</view>
					</view>
					<view class="div">
						<view class="titles">
							常见问题
						</view>
						<view class="contents">
							{{checkProblem}}
						</view>
					</view>
					<view class="closeReturn" @tap="inspectionGuidelinesClose">关闭</view>
				</view>
			</view>
		</uni-popup>
		<!-- 提交弹窗 -->
		<uni-popup ref="popupTwo" type="bottom">
			<view class="popupContent">
				<view class="title">确定</view>
				<view class="box">
					提交当前检查？
				</view>
				<view class="button" style="padding-bottom:20px;">
					<button class="determine" @click="determineTwo">确认</button>
					<button class="cancellation" @click="cancellationTwo">返回</button>
				</view>
			</view>
		</uni-popup>
		<!-- 结果记录 -->
		<uni-popup ref="resultLog" type="bottom" :mask-click="false">
			<view class="popupContent" style="padding-bottom: 20px;">
				<view class="title">结果记录</view>
				<view class="box">
					<view class="box-item">
						<view class="box-item-left">
							<view style="width: 150px;text-align: left;"><text>日常监督检查要点表:</text></view>
							<image :src="yaodianbiao == '' ? '/static/img/no-pic.png' : yaodianbiao"
								style="width: 100px;height: 100px;" @tap="showImage(yaodianbiao)"></image>
						</view>
						<text class="btna" @tap="pointsTable">生成检查要点表</text>
					</view>

					<view class="box-item" style="margin-top: 10px;">
						<view class="box-item-left">
							<view style="width: 150px;text-align: left;"><text>结果记录表:</text></view>
							<image :src="jieguojilu == '' ? '/static/img/no-pic.png' : jieguojilu"
								style="width: 100px;height: 100px;" @tap="showImage(jieguojilu)"></image>
						</view>
						<text class="btna" @tap="resultTable( addInspectData.companyTypeName)">生成结果记录表</text>
					</view>
					<view class="box-item" @tap="pointCheck"
						style="text-align: center;display: flex;align-items: center;justify-content: center;margin-top: 20px;">
						<text v-if="checkDistance <= distance" class="location-status">您在检查区域内</text>
						<text v-if="checkDistance > distance" class="location-active">您不在检查区域内</text>
					</view>
				</view>
				<view class="button">
					<button class="determine" @click="finalConfirm()">确认</button>
					<button class="cancellation" @click="closeResultLog()">取消</button>
				</view>
			</view>
		</uni-popup>
		<!-- 显示告知单预览 -->
		<uni-popup ref="popupNotificationTwo" type="bottom">
			<view ref="popupNotificationContent" class="popupContent"
				style="padding: 14px;padding-bottom: 50px;overflow-y: auto;">
				<view id="scrrent-page">
					<view style="text-align: center;font-size: 23px;font-weight: 700;">食品经营销售日常监督检查要点表</view>
					<view style="text-align: center;font-size: 18px;font-weight: 700;">告知页</view>
					<view style="border: 1px solid #dadada;padding: 10px;margin-top: 20px;">
						<view class="item-text">被检查单位：{{addInspectData.companyName}}</view>
						<view class="item-text">地址：{{addInspectData.companyAddress}}</view>
						<view class="item-text">告知事项：{{notificationText | notificationFilter(this)}}</view>
						<view class="item-text"> 问：你（单位）是否申请回避？</view>
						<view class="item-text"> {{applyForAvoidanceList[applyForAvoidanceValue].text}} </view>
						<view class="item-text">
							检查单位签字: <image class="sig-image" :src="sigOnePic"></image>
						</view>
						<view class="item-text">
							检查人员1签字: <image class="sig-image" :src="sigTwoPic"></image>
						</view>
						<view class="item-text">
							检查人员2签字: <image class="sig-image" :src="sigThreePic"></image>
						</view>
					</view>
				</view>
				<view class="button">
					<button class="determine" @click="printNotification">确认</button>
					<button class="cancellation" @click="closeNotification">关闭</button>
				</view>
			</view>
		</uni-popup>

		<screenshot ref="screenshot" :screenId="'scrrent-page'" @renderFinish="getScreenImg"></screenshot>
	</view>
</template>

<script>
	import longscreen from '@/components/screenShot.vue'
	import jsPDF from 'jspdf';
	import html2canvas from 'html2canvas';
	import commonNavBar from '@/components/CommonNavBar.vue';

	export default {
		components: {
			commonNavBar,
			'screenshot': longscreen
		},
		data() {
			return {
				detail: false,
				baseUrl: uni.$baseUrl,
				selectedContent: null, //被选中的检查内容
				checkDistance: 0, //监察人与企业的距离 
				distance: 0, //规定检查人与企业多少范围内可提交数据
				checkResultStatus: '2',
				errNum: 0, //选择否的
				yaodianbiao: '',
				jieguojilu: '',
				checkId: '', //检查id，在临时保存之后会获取到 
				sigPic: '',
				sigOnePic: '',
				sigTwoPic: '',
				sigThreePic: '',
				checkBasis: '’', //检查指南中的检查依据
				checkGuide: '', //检查指南中的检查方式
				checkMethod: '', //检查指南中的检查指南
				checkProblem: '', //检查指南中的常见问题
				emphasisNum: 0, //重点项问题数
				generalNum: 0, //一般项问题数
				totalEmphasisNum: 0, //一般项问题数选择异常的时候拉满
				totalGeneralNum: 0, //一般项问题数选择异常的时候拉满
				companyId: null, //企业id  
				checkNum: 0, //检查次数
				checkContentRiskList: [],
				userList: [],
				stepList: [{
					step: '基础信息',
					active: true
				}, {
					step: '检查内容',
					active: false
				}, {
					step: '风险提示',
					active: false
				}],
				inspectTime: '',
				businessStatusList: [{
						id: '0',
						option: '正常',
						isChecked: true
					},
					{
						id: '1',
						option: '异常',
						isChecked: false
					}
				],
				abnormalCauseList: [{
					value: "不在注册地经营",
					text: "不在注册地经营"
				}],
				imagesLimit: 9,
				applyForAvoidanceValue: 0,
				applyForAvoidanceList: [{
						value: 0,
						text: "否"
					},
					{
						value: 1,
						text: "是"
					},
				],
				processingResultsList: [{
						id: '1',
						option: '通过检查',
						isChecked: true
					},
					{
						id: '2',
						option: '责令整改',
						isChecked: false
					},
					{
						id: '3',
						option: '调查处理',
						isChecked: false
					}
				],
				addInspectData: {},
				activeIndex: [],
				activeOption: [],
				problemDescriptionList: [{
						value: '未按要求标注相关信息',
						text: "未按要求标注相关信息"
					},
					{
						value: '标注内容不合法',
						text: "标注内容不合法"
					},
					{
						value: '自定义备注',
						text: "自定义备注"
					},
				],
				inspectionInstructionsList: [{
						value: "仅销售预包装食品，无需取得食品经营许可",
						text: "仅销售预包装食品，无需取得食品经营许可"
					},
					{
						value: "自定义备注",
						text: "自定义备注"
					},
				],
				riskWarningData: {},
				addInspectriskLookData: [],
				taskAssociationList: [{
						id: 1,
						title: '开学季专项检查',
					},
					{
						id: 2,
						title: '夏季食品清理治理',
					},
					{
						id: 3,
						title: '针对非法添加的专项整治',
					},
					{
						id: 4,
						title: '如涉及到大型活动的安全保障',
					}
				],
				notificationText: uni.$notificationText,
				taskAssociationChangeList: [],
				hasContentSelect2Or3: false
			}
		},
		onLoad(options) {
			const that = this;
			this.unplannedCompanyId = options.unplannedCompanyId
			this.companyId = options.companyId
			this.detail = options.detail == 'true' ? true : false


		},
		onReady() {
			//this.$refs.resultLog.open();
			// 任务关联
			//this.taskAssociationOpen() 
			// 初始日期 
			const currentDate = new Date();
			const year = currentDate.getFullYear();
			const month = String(currentDate.getMonth() + 1).padStart(2, '0');
			const day = String(currentDate.getDate()).padStart(2, '0');
			const formattedDate = `${year}-${month}-${day}`;
			this.inspectTime = formattedDate
			// 基础信息数据
			this.basicInformationData();
			//获取监管用户信息
			this.loadUserList();
			// 风险提示数据0
			this.riskWarning(this.companyId)
		},
		filters: {
			notificationFilter(value, that) {
				return value.replace(/\${([^}]+)}/g, that.addInspectData.deptName);
			},
			userNameFilter(value, that) {
				for (var i = 0; i < that.userList.length; i++) {
					if (that.userList[i].id == value) {
						return that.userList[i].text;
					}
				}
				return '';
			}
		},
		methods: {
			// 获取基础信息数据
			async basicInformationData() {
				const that = this;
				uni.showLoading({
					title: '加载页面数据',
					mask: true

				})
				//可能是空，如果是空则是为检查过，后台会自动生成一个空的单子)

				const res = await uni.$api.getSpecialBaseInfo({
					unplannedCompanyId: this.unplannedCompanyId
				});
				if (res.data.code != '0') {
					uni.hideLoading();
					uni.showModal({
						title: '警告',
						content: res.data.message,
						showCancel: false,
					})
					return;
				}
				that.addInspectData = res.data.data
				that.checkId = res.data.data.id;
				that.distance = res.data.data.distance;
				// 企业未标注不校验距离/
				let lngLat = that.addInspectData.lngLat + '';
				if (lngLat != 'undefined' && lngLat != undefined) {
					that.checkDistance = await uni.$mapUtil.getPointDistance(lngLat.split(',')[1], lngLat.split(',')[
						0]);
				}
				if (res.data.data.resultRecordUrl != undefined) {
					that.jieguojilu = that.baseUrl + res.data.data.resultRecordUrl;
				}
				if (res.data.data.checkItemTableUrl != undefined) {
					that.yaodianbiao = that.baseUrl + res.data.data.checkItemTableUrl;
				}
				this.loadErrorNum();
				// 检查内容可选数据
				uni.hideLoading()
			},
			async loadUserList() {
				//获取监管人员信息
				const useRes = await uni.$api.getSupervisePersonList();
				for (var i = 0; i < useRes.data.data.length; i++) {
					this.userList.push({
						value: useRes.data.data[i].value,
						text: useRes.data.data[i].name + ''
					})
				}
				console.log(this.userList)
			},
			// 基础信息经营状态是否正常
			businessStatusRadioChange(option) {
				this.$set(this.addInspectData, "manageStatus", option.detail.value)
			},
			showNoticeControl(filePath) {
				const that = this;
				if (filePath == undefined || filePath == 'undefined') {
					that.noticeFormOpen();
					return;
				}
				uni.showActionSheet({
					itemList: ['查看文件', '重新生成'],
					title: '选择操作',
					success: function(res) {
						if (res.tapIndex == 0) {
							Vue.prototype.$previewImage(filePath);
						} else if (res.tapIndex == 1) {
							that.noticeFormOpen();
						}
					}
				})
			},
			// 基础信息告知页
			noticeFormOpen() {
				const that = this;
				uni.showActionSheet({
					itemList: ['生成告知单', '选择文件'],
					title: '选择操作',
					success: function(res) {
						if (res.tapIndex == 0) {
							that.$refs.noticeForm.open('bottom');
						} else if (res.tapIndex == 1) {
							uni.chooseImage({
								count: 1,
								// sourceType:['camera'],
								success: (e) => {
									plus.io.resolveLocalFileSystemURL(e.tempFilePaths[0], function(
										entry) {
										//参数path:图片相对路径
										entry.file(function(file) {
											var fileReader = new plus.io
												.FileReader()
											fileReader.readAsDataURL(file)
											fileReader.onloadend = function(evt) {
												// let base64 = evt.target.result.split(",")[1]
												// console.log('获取到base64',evt.target.result);
												that.saveNotice(evt.target
													.result);
											}
										})
									})
								},
								fail: () => {
									uni.showToast({
										icon: 'error',
										title: '图片选择错误'
									})
								}
							})
						}
					}
				})
			},
			facadePhotoControl(filePath) {
				const that = this;
				if (filePath == undefined || filePath == 'undefined') {
					that.facadePhotoOpen();
					return;
				}
				uni.showActionSheet({
					itemList: ['查看文件', '重新上传'],
					title: '选择操作',
					success: function(res) {
						if (res.tapIndex == 0) {
							Vue.prototype.$previewImage(filePath);
						} else if (res.tapIndex == 1) {
							that.facadePhotoOpen();
						}
					}
				})

			},
			//上传门脸照片
			facadePhotoOpen() {
				const that = this;
				uni.chooseImage({
					count: 1,
					// sourceType:['camera'],
					success: (e) => {
						uni.uploadFile({
							url: '/dailyInspect/uploadCheckFile',
							filePath: e.tempFilePaths[0],
							header: {
								'content-Type': 'multipart/form-data',
							},
							name: 'file',
							formData: {
								checkId: that.checkId
							},
							success: (res) => {
								const result = JSON.parse(res.data);
								if (result.code === 0) {
									uni.showToast({
										title: '上传成功',
										icon: 'error'
									})
									that.$set(that.addInspectData, "comanyPic", result.data
										.comanyPic);
								} else {
									uni.showToast({
										title: '上传失败',
										icon: 'error'
									})
								}
							},
							fail: () => {
								uni.showToast({
									title: '上传失败',
									icon: 'error'
								})
							}
						})
					},
					fail: () => {
						uni.showToast({
							icon: 'error',
							title: '图片选择错误'
						})
					}
				})
			},
			// 基础信息告知页保存
			noticeFormDetermine() {
				if (this.sigOnePic == '' || this.sigOnePic == undefined) {
					uni.showToast({
						title: '请完成签名',
						icon: 'none'
					})
					return;
				}
				if (this.sigTwoPic == '' || this.sigTwoPic == undefined) {
					uni.showToast({
						title: '请完成签名',
						icon: 'none'
					})
					return;
				}
				if (this.sigThreePic == '' || this.sigThreePic == undefined) {
					uni.showToast({
						title: '请完成签名',
						icon: 'none'
					})
					return;
				}
				this.$refs.popupNotificationTwo.open();
			},
			// 基础信息告知页预览打印
			noticeFormCancellation() {
				if (this.sigOnePic == '' || this.sigOnePic == undefined) {
					uni.showToast({
						title: '请完成签名',
						icon: 'none'
					})
					return;
				}
				if (this.sigTwoPic == '' || this.sigTwoPic == undefined) {
					uni.showToast({
						title: '请完成签名',
						icon: 'none'
					})
					return;
				}
				if (this.sigThreePic == '' || this.sigThreePic == undefined) {
					uni.showToast({
						title: '请完成签名',
						icon: 'none'
					})
					return;
				}
				this.$refs.popupNotificationTwo.open();
			},
			printNotification() {
				const that = this;
				uni.showLoading({
					title: '正在生成',
					mask: true
				})

				//将告知单存储页面生成图片保存到相册并上传到服务器
				this.$refs.screenshot.startScreen();
			},
			async saveNotice(noticePic) {
				const that = this;
				const res = await uni.$api.saveCheckInform({
					checkId: that.checkId,
					checkPerson1Id: this.addInspectData.checkPerson1Id,
					checkPerson2Id: this.addInspectData.checkPerson2Id,
					isAvoid: this.applyForAvoidanceValue,
					notifyMatters: this.notificationText,
					companySignFile: this.sigOnePic,
					checkPerson1SignFile: this.sigTwoPic,
					checkPerson2SignFile: this.sigThreePic,
					informFile: noticePic
				});

				uni.hideLoading();
				if (res.data.code == '0') {
					that.$set(that.addInspectData, "informUrl", res.data.data);
					uni.showModal({
						content: '保存成功,告知单图片已自动存储到相册',
						title: '提示',
						showCancel: false,
						success: function() {
							that.$refs.popupNotificationTwo.close();
							that.$refs.noticeForm.close();
						}
					})
				} else {
					uni.showToast({
						icon: 'success',
						title: '告知单存储失败'
					})
				}
			},
			getScreenImg(res) {
				//生成告知单图片的
				const that = this;
				//根据传输过来的id 和选中的图片传到后台直接保存 
				uni.saveImageToPhotosAlbum({
					filePath: res.posterPath,
					success: function() {
						uni.hideLoading();
						uni.showLoading({
							title: '正在保存告知单信息',
							mask: true
						})
						plus.io.resolveLocalFileSystemURL(res.posterPath, function(entry) {
							//参数path:图片相对路径
							entry.file(function(file) {
								var fileReader = new plus.io.FileReader()
								fileReader.readAsDataURL(file)
								fileReader.onloadend = function(evt) {
									// let base64 = evt.target.result.split(",")[1]
									// console.log('获取到base64',evt.target.result);
									that.saveNotice(evt.target.result);
								}
							})
						})
					},
					fail: () => {
						uni.hideLoading();
						uni.showToast({
							icon: 'error',
							title: '请给与相册权限，否则告知单将无法存贮在手机中'
						})
					}
				})

			},

			// 关闭告知页预览打印
			closeNotification() {
				this.$refs.popupNotificationTwo.close()
			},
			// 检查内容检查结果
			accordRadioChange(option) {
				this.$set(this.addInspectData, 'checkResult', option.target.value);
			},
			// 检查内容处理结果
			handleRadioChange(option) {
				this.$set(this.addInspectData, 'processResults', option.target.value);
			},
			// 检查内容记录表选项选中状态
			switchSelection(index, dataIndex, result) {
				//数据存储在本地  
				var d = this.addInspectData.standardList[index].contentList[dataIndex];
				this.$set(d, "selection", result);
				//修改问题项数量
				this.loadErrorNum();

				let allYes = true;
				let hasNoOrReasonable = false;
				let hasBasicCompliance = false;
				let falseList = [];

				for (var i = 0; i < this.addInspectData.standardList.length; i++) {
					for (var y = 0; y < this.addInspectData.standardList[i].contentList.length; y++) {
						let content = this.addInspectData.standardList[i].contentList[y];
						let contentSelect = this.addInspectData.standardList[i].contentList[y].selection;

						if (contentSelect !== undefined && typeof contentSelect === 'string') {
							contentSelect = Number(contentSelect);
						}

						if (contentSelect !== 1 && contentSelect !== undefined) {
							allYes = false;
							falseList.push(this.addInspectData.standardList[i].contentList[y]);

							if (content.importentItem === "2") {
								hasNoOrReasonable = true;
								break;
							} else if (content.importentItem === "1" && (contentSelect === 2 || contentSelect === 3)) {
								hasBasicCompliance = true;
							}
						}
					}
					if (hasNoOrReasonable) break;
				}

				this.falseCount = falseList.length;
				if (this.falseCount > 0) {
					if (hasNoOrReasonable) {
						this.$set(this.addInspectData, "checkResult", '不符合');
					} else if (hasBasicCompliance) {
						this.$set(this.addInspectData, "checkResult", '基本符合');
					}
					this.hasContentSelect2Or3 = true;
				} else {
					this.$set(this.addInspectData, "checkResult", '符合');
					this.hasContentSelect2Or3 = false;
				}
			},
			contentSelectedStatus(index, dataIndex) {
				//实现选中样式 
				this.selectedContent = 'content' + index + ':' + dataIndex;
			},
			// 检查内容记录表选项-否-问题描述
			problemDescriptionChange(e, index, dataIndex, templateId, standardId, contentId, result) {
				var d = this.addInspectData.standardList[index].contentList[dataIndex];
				this.$set(d, "problemContent", e);
			},
			// 选择否-自定义的时候上传文件信息
			async uploadContentFile(index, dataIndex, standardId, contentId) {
				const that = this;
				uni.chooseImage({
					count: 1,
					success: (e) => {
						plus.io.resolveLocalFileSystemURL(e.tempFilePaths[0], function(entry) {
							entry.file(function(file) {
								var fileReader = new plus.io.FileReader()
								fileReader.onload = function(evt) {
									that.$set(that.addInspectData.standardList[index]
										.contentList[dataIndex], "problemFile", evt
										.target.result);
								}
								fileReader.readAsDataURL(file)
							}, function(error) {
								uni.showToast({
									title: '图片生成失败',
									icon: 'error'
								})
							})
						}, function(error) {
							uni.showToast({
								title: '获取文件失败',
								icon: 'error'
							})
						})
					},
					fail: () => {
						uni.showToast({
							icon: 'error',
							title: '图片选择错误'
						})
					}
				})
			},
			showContentFileControls(index, dataIndex, standardId, contentId, filePath) {
				//检查内容选否之后上传文件后点击弹出选择查看文件还是上传文件
				const that = this;
				uni.showActionSheet({
					itemList: ['查看文件', '重新上传'],
					title: '选择操作',
					success: function(res) {
						if (res.tapIndex == 0) {
							Vue.prototype.$previewImage(filePath);
						} else if (res.tapIndex == 1) {
							that.uploadContentFile(index, dataIndex, standardId, contentId);
						}
					}
				})


			},
			// 检查内容记录表选项-合理缺项-问题描述
			async inspectionInstructionsChange(e, index, dataIndex, templateId, standardId, contentId, result) {
				var d = this.addInspectData.standardList[index].contentList[dataIndex];
				this.$set(d, "missingItemContent", e);
			},
			// 风险提示数据
			async riskWarning(companyId) {
				const res = await uni.$api.getCompanyRiskInfo({
					companyId: companyId
				});
				this.riskWarningData = res.data.data
				// 风险提示-弹窗
				if (Object.keys(this.riskWarningData).length !== 0) {
					this.riskWarningPopup()
				}
			},
			// 风险提示-查看详情
			async addInspectriskLook(number) {
				let data = {
					companyId: this.companyId,
					riskType: number
				}

				try {
					const res = await uni.$api.getRiskInfo(data);
					this.addInspectriskLookData = res.data.data
					if (this.$refs.riskReminderDetails) {
						this.$refs.riskReminderDetails.open('bottom')
					}
				} catch (error) {
					console.error(error)
				}
			},
			// 风险提示-查看详情-返回
			riskReminderDetailsClose() {
				this.$refs.riskReminderDetails.close()
			},
			// 任务关联
			taskAssociationOpen() {
				if (this.$refs.taskAssociation) {
					this.$refs.taskAssociation.open('bottom')
				}
			},
			// 任务关联-选中
			taskAssociationChange(item) {
				const index = this.taskAssociationChangeList.findIndex((selectedItem) => selectedItem.id === item.id);
				if (index >= 0) {
					this.taskAssociationChangeList.splice(index, 1);
				} else {
					this.taskAssociationChangeList.push(item);
				}
			},
			// 任务关联-确认按钮
			taskAssociationDetermine() {
				console.log(this.taskAssociationChangeList);
			},
			// 任务关联-取消按钮
			taskAssociationCancellation() {
				this.$refs.taskAssociation.close('bottom')
			},
			// 基础信息-风险提示弹窗
			riskWarningPopup() {
				if (this.$refs.riskWarningPopup) {
					this.$refs.riskWarningPopup.open('bottom')
				}
			},
			// 基础信息-风险提示弹窗-我已知晓
			IAlreadyKnow() {
				this.$refs.riskWarningPopup.close('bottom')
			},
			// 检查内容-操作指南
			inspectionGuidelines(checkBasis, //检查指南中的检查依据
				checkGuide, //检查指南中的检查方式
				checkMethod, //检查指南中的检查指南
				checkProblem) {
				this.checkBasis = checkBasis
				this.checkGuide = checkGuide
				this.checkMethod = checkMethod
				this.checkProblem = checkProblem
				if (this.$refs.inspectionGuidelines) {
					this.$refs.inspectionGuidelines.open('bottom')
				}
			},
			// 检查内容-操作指南-关闭
			inspectionGuidelinesClose() {
				this.$refs.inspectionGuidelines.close('bottom')
			},
			loadErrorNum() {
				//计算选择的重点项发现问题数，一般项发现问题数量
				this.totalEmphasisNum = 0; //重点项问题数
				this.totalGeneralNum = 0; //重点项问题数
				this.emphasisNum = 0; //重点项问题数
				this.generalNum = 0; //一般项问题数
				this.errNum = 0; //选择否的数量
				var itemList = this.addInspectData.standardList;
				for (var i = 0; i < itemList.length; i++) {
					for (var y = 0; y < itemList[i].contentList.length; y++) {
						if (itemList[i].contentList[y].importentItem == '2') {
							this.totalEmphasisNum = this.totalEmphasisNum + 1;
							if (itemList[i].contentList[y].selection == '2') {
								this.errNum = this.errNum + 1;
								this.emphasisNum = this.emphasisNum + 1;
							}
						} else {
							this.totalGeneralNum = this.totalGeneralNum + 1;
							if (itemList[i].contentList[y].selection == '2') {
								this.errNum = this.errNum + 1;
								this.generalNum = this.generalNum + 1;
							}
						}
					}
				}

				if (this.errNum > 0) {
					this.checkResultStatus = '1'
					this.$set(this.addInspectData, "processResults", "");
				} else {
					this.checkResultStatus = '2'
					this.$set(this.addInspectData, "processResults", "1");
				}
			},
			//保存数据
			async savePopup(type) {
				this.saveType = type
				if (type == '1') {
					//临时保存
					this.determineTwo();
					return;
				}
				uni.showLoading({
					title: '校验位置',
					mask: true
				})
				let lngLat = this.addInspectData.lngLat + '';
				if (lngLat == undefined || lngLat == 'undefined') {
					uni.showToast({
						title: '企业位置未标注',
						icon: 'error',
						duration: 5000
					})
					return
				}
				//当前企业与设备的距离
				this.checkDistance = await uni.$mapUtil.getPointDistance(lngLat.split(',')[1], lngLat.split(',')[0]);
				uni.hideLoading();
				if (this.checkDistance > this.addInspectData.distance) {
					let num = this.checkDistance - this.addInspectData.DISTANCE;
					let result = num.toFixed(2);
					//if(this.checkDistance > Number(uni.$distance)){
					uni.showToast({
						title: '不在检查范围，距离还有：' + result + "米",
						icon: 'none',
						duration: 5000
					})
					return
				}
				if (type != '1') {
					//表单填写验证
					if (this.addInspectData.checkPerson1Id == '' || this.addInspectData.checkPerson1Id == undefined) {
						uni.showToast({
							title: '请选择执法人员',
							icon: 'none'
						})
						return;
					}
					if (this.addInspectData.checkPerson2Id == '' || this.addInspectData.checkPerson2Id == undefined) {
						uni.showToast({
							title: '请选择执法人员',
							icon: 'none'
						})
						return;
					}
					if (this.addInspectData.manageStatus == '' || this.addInspectData.manageStatus == undefined) {
						uni.showToast({
							title: '请选择经营状态',
							icon: 'none'
						})
						return;
					}
					if (this.addInspectData.manageStatus == '0') {
						//非异常情况
						if (this.addInspectData.processResults == '' || this.addInspectData.processResults ==
							undefined) {
							uni.showToast({
								title: '请选择检查内容中的处理结果',
								icon: 'none'
							})
							return;
						}
						//检查内容是否全部选择 
						const itemList = this.addInspectData.standardList;
						for (var y = 0; y < itemList.length; y++) {
							const contentList = itemList[y].contentList;
							for (var i = 0; i < contentList.length; i++) {
								if (contentList[i].selection == '' || contentList[i].selection == undefined) {
									uni.showToast({
										title: '存在检查内容还未处理',
										icon: 'none'
									})
									return;
								} else {
									//如果已经选择否了
									if (contentList[i].selection == '2' && contentList[i].problemFile == undefined) {
										uni.showToast({
											title: '选择否的检查内容需要上传文件信息',
											icon: 'none'
										})
										return;
									} else if (contentList[i].selection == '2' && contentList[i].problemContent ==
										undefined) {
										uni.showToast({
											title: '有检查内容的问题描述信息未选择',
											icon: 'none'
										})
										return;
									} else if (contentList[i].selection == '2' && contentList[i].problemContent ==
										'自定义备注' && contentList[i].problemContentInput == undefined) {
										uni.showToast({
											title: '有检查内容的问题描述中自定义备注信息未填写',
											icon: 'none'
										})
										return;
									} else if (contentList[i].selection == '3' && contentList[i].missingItemContent ==
										'自定义备注' && contentList[i].missingItemContentInput == undefined) {
										uni.showToast({
											title: '有检查内容的合理缺项中自定义备注信息未填写',
											icon: 'none'
										})
										return;
									} else if (contentList[i].selection == '3' && contentList[i].missingItemContent ==
										undefined) {
										uni.showToast({
											title: '有检查内容中的合理缺项未选择原因',
											icon: 'none'
										})
										return;
									}


								}
							}
						}

						//选择责令整改或者调查处理的时候验证整改时间是否选择
						if (this.addInspectData.processResults != '1' && this.addInspectData.rectificationTimeLimit ==
							undefined) {
							uni.showToast({
								title: '请选择整改时间',
								icon: 'none'
							})
							return;
						}

					}
					if (this.addInspectData.manageStatus == '1') {
						//异常情况
						/* if(this.addInspectData.abnormalCause == ''  || this.addInspectData.abnormalCause  == undefined ){
							uni.showToast({
								title:'请选择异常原因',
								icon : 'none'
							})
							return;
						} */
						if (this.addInspectData.abnormalVerificationRecord == '' || this.addInspectData
							.abnormalVerificationRecord == undefined) {
							uni.showToast({
								title: '请填写异常情况核查记录',
								icon: 'none'
							})
							return;
						}
						if (this.addInspectData.rectificationTimeLimit == '' || this.addInspectData
							.rectificationTimeLimit == undefined) {
							uni.showToast({
								title: '请选择整改日期',
								icon: 'none'
							})
							return;
						}
					}
				}
				this.$refs.popupTwo.open('bottom')
			},
			//取消保存
			cancellationTwo() {
				this.$refs.popupTwo.close()
			},
			async determineTwo() {

				const that = this;
				//选择的检查结果项  
				try {
					uni.showLoading({
						title: '正在生成数据，请稍后',
						mask: true
					})
					// if(this.addInspectData.manageStatus == '1'){
					// 	this.addInspectData.checkResult = '重点项发现问题（'+ this.totalEmphasisNum +'）项,一般项发现问题（'+ this.totalGeneralNum +'）项';
					// } else {
					// 	this.addInspectData.checkResult = '重点发现问题（'+ this.emphasisNum +'）项,一般发现问题 （'+ this.generalNum +'）项';
					// }  

					const res = await uni.$api.saveSpecialCheckInfo({
						'temporary': (this.saveType != '1' && this.addInspectData.manageStatus == '1') ? '2' :
							'1',
						"checkData": JSON.stringify(this.addInspectData)
					});
					uni.hideLoading();
					uni.showToast({
						title: res.data.message,
						icon: 'success',
						image: '/static/img/success.png',
						duration: 2000,
					});
					this.$refs.popupTwo.close();
					if (res.data.code == '0') {
						that.checkId = res.data.data.id
						//检查是否在检查区域内 
						if (this.saveType != '1' && this.addInspectData.manageStatus == '0') {
							that.$refs.resultLog.open();
						} else {
							//临时保存 
							uni.showToast({
								title: '保存完成',
								icon: 'success',
								image: '/static/img/success.png',
								duration: 2000,
							});
							if (this.addInspectData.manageStatus == '1') {
								//如果是经营异常 保存完成返回列表
								const eventChannel = that.getOpenerEventChannel();
								eventChannel.emit('reloadList');
								uni.navigateBack();
								/* uni.redirectTo({
									url: '/pages/specialInspect/specialInspect'
								}); */
							}
						}
					}
				} catch (error) {
					console.error(error)
				}
			},
			closeResultLog() {
				this.$refs.resultLog.close();
			},
			async finalConfirm() {
				const that = this;
				//经营异常的时候不用判断这两个表
				if (this.jieguojilu == '' && this.addInspe) {
					uni.showToast({
						title: '请先上传或生成结果记录表',
						icon: 'none'
					})
					return;
				}
				if (this.yaodianbiao == '' && this.addInspectData.manageStatus == '0') {
					uni.showToast({
						title: '请先上传或生成结果要点表',
						icon: 'none'
					})
					return;
				}
				//认证定位距离 

				//修改检查单为检查完成
				uni.showLoading({
					title: '正在保存，请稍后',
					mask: true
				})
				const res3 = await uni.$api.finaSpecialSaveInfo({
					'checkId': this.checkId,
					'processResults': this.addInspectData.checkResults,
					'rectificationTimeLimit': this.addInspectData.rectificationTimeLimit,
					'temporary': '2', //正式存储 
				});
				uni.showToast({
					title: res3.data.message,
					icon: 'success',
					image: '/static/img/success.png',
					duration: 2000,
				});
				uni.hideLoading();
				if (res3.data.code == '0') {
					const eventChannel = that.getOpenerEventChannel();
					eventChannel.emit('reloadList');
					uni.navigateBack();
					/* uni.redirectTo({
						url: '/pages/specialInspect/specialInspect'
					}); */
				}
			},
			//认证主体是否已经标注
			isLocationPoint(lng_lat) {
				if (lng_lat != undefined && lng_lat != '' && lng_lat != 'undefined') {
					return true;
				} else {
					return false;
				}
			},
			companyDimension(lng_lat) {
				//进入到企业标注
				const that = this;
				// if (lng_lat != undefined && lng_lat != '' && lng_lat != 'undefined') {
				// 	//已经标注过了
				// 	uni.navigateTo({
				// 		url: '/pages/dimension/showPoint?companyId=' + this.companyId + '&lng_lat=' + lng_lat
				// 	})
				// 	return;
				// }
				uni.navigateTo({
					url: '/pages/dimension/dimension?companyId=' + this.companyId + '&lng_lat=' + lng_lat,
					events: {
						// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
						updateLngLat: function(data) {
							that.$set(that.addInspectData, "lngLat", data.lng_lat);
						}
					},
				})
			},
			showImage(url) {
				Vue.prototype.$previewImage(url);
			},
			pointsTable() {
				const that = this;
				//生成要点表
				uni.navigateTo({
					url: '/pages/inspect/checkPointTable?id=' + this.checkId,
					events: {
						// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
						yaodianbiao: function(data) {
							console.log(data)
							that.yaodianbiao = that.baseUrl + data
						}
					}
				})
			},
			resultTable(supProcess) {
				const that = this;
				//生成结果记录表
				if (supProcess == 'spxs' || supProcess == 'cyfw') {

					uni.navigateTo({
						url: '/pages/inspect/resultTable?id=' + this.checkId,
						events: {
							/// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
							yaodianbiao: function(data) {
								that.jieguojilu = that.baseUrl + data
							}
						}
					})
				} else {
					uni.navigateTo({

						url: '/pages/inspect/productionResultTable?id=' + this.checkId,
						events: {
							// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
							yaodianbiao: function(data) {
								that.jieguojilu = that.baseUrl + data
							}
						}
					})
				}
			},
			// 回到首页
			goBack() {
				uni.navigateBack()
			},
			checkExist(v1, v2, v3, v4) {
				//判断是否存在检查指南
				if ((v1 == undefined || v1 == '') && (v2 == undefined || v2 == '') && (v3 == undefined || v3 == '') && (
						v4 == undefined || v4 == '')) {
					return false;
				} else {
					return true;
				}


			},
			// 跳转只能客服
			robot() {
				let message = "";
				if (this.selectedContent != null && this.selectedContent != '') {
					let selectedContent = this.selectedContent;
					selectedContent = selectedContent.replace('content', "");
					let selectedContentArray = selectedContent.split(':');
					var d = this.addInspectData.standardList[selectedContentArray[0]].contentList[selectedContentArray[1]];
					message = d.checkContent;
				}
				uni.navigateTo({
					url: '/pages/robot/robot',
					success: (res) => {
						res.eventChannel.emit('sendDefaultMessage', {
							message: message
						})
					}

				})
			},
			async signatureOne() {
				const that = this;
				//签名
				uni.navigateTo({
					url: '/pages/signature/signature',
					events: {
						updateSign(data) {
							that.sigOnePic = data;
						}
					}
				})
			},
			async signatureTwo(index) {
				const that = this;
				//签名
				uni.navigateTo({
					url: '/pages/signature/signature',
					events: {
						updateSign(data) {
							that.sigTwoPic = data;
						}
					}
				})
			},
			async signatureThree(index) {
				const that = this;
				//签名
				uni.navigateTo({
					url: '/pages/signature/signature',
					events: {
						updateSign(data) {
							that.sigThreePic = data;
						}
					}
				})
			},
			// 切换选项卡
			stepActive(index) {
				// if(this.addInspectData.manageStatus == '1' && index == 1){
				// 	uni.showToast({
				// 		title:'经营异常无需维护检查内容',
				// 		icon:'none'
				// 	})
				// 	return ;
				// }
				this.stepList.forEach((item, idx) => {
					item.active = idx === index;
				});
			},
			pointCheck() {
				const that = this;
				//进入到定位查看
				let LNG_LAT = this.addInspectData.lngLat + "";
				uni.navigateTo({
					url: '/pages/inspect/pointCheck?lng=' + LNG_LAT.split(",")[0] + '&lat=' + LNG_LAT.split(",")[
						1],
					events: {
						// 为指定事件添加一个监听器，获取被打开页面传送到当前页面的数据
						updatePoint: function(data) {
							that.basicInformationData();
						},
					},
				})

			},
			async showRiskContent(checkContentId) {
				//查看风险提示
				uni.showLoading({
					title: '获取信息',
					mask: true
				})
				this.checkContentRiskList = [];
				const res = await uni.$api.getRiskTypeByCheckContent({
					checkContentId: checkContentId
				})
				uni.hideLoading();
				if (res.data.code == '0') {
					this.checkContentRiskList = res.data.data;
				}
				this.$refs.riskTypePopup.open("bottom");
			},
			riskTypePopupClose() {
				this.$refs.riskTypePopup.close();
			}, // 基础信息整改时间选择日期
			rectificationTimeClick(e) {
				this.$set(this.addInspectData, 'rectificationTimeLimit', e.target.value);
			},

		},
		watch: {

		}
	}
</script>

<style lang="scss">
	.addInspectTabsContent {
		background: #F9F9F9;
		height: calc(100vh - 195rpx);

		.upper {
			position: fixed;
			z-index: 1;
			top: 0;
			left: 0;
			width: 100%;

			.title {
				background: url('/static/img/inspectBg.png');
				background-size: cover;
				width: 100%;
				height: 115rpx;
				line-height: 115rpx;
				position: relative;
				display: flex;
				justify-content: center;

				.arrow {
					position: absolute;
					left: 33rpx;
					top: 50%;
					transform: translate(0%, -50%);
					width: 100rpx;
					height: 100rpx;

					&::before {
						display: block;
						content: "";
						position: absolute;
						top: 50%;
						left: 0%;
						width: 20rpx;
						height: 20rpx;
						border-left: 1px solid #fff;
						border-top: 1px solid #fff;
						transform: translate(0%, -50%) rotate(-45deg);
					}
				}

				text {
					font-size: 30rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #FFFFFF;
					letter-spacing: 1px;
				}

				.intelligence {
					position: absolute;
					right: 30rpx;
					top: 50%;
					transform: translate(0%, -50%);
					font-size: 28rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #FFFFFF;
					display: flex;

					image {
						width: 75rpx;
						height: 64rpx;
					}
				}
			}

			.step {
				display: flex;
				justify-content: space-around;
				height: 80rpx;
				line-height: 80rpx;
				background: #F9F9F9;

				view {
					position: relative;
					font-size: 25rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;

					&.active {
						color: #0552A9;

						&::before {
							display: block;
							content: "";
							position: absolute;
							left: 50%;
							bottom: 0%;
							transform: translate(-50%, 0%);
							width: 100rpx;
							height: 5rpx;
							background: #0552A9;
						}
					}
				}
			}
		}

		.centre {
			margin: 195rpx 0 0 0;
			// padding: 0 17.5rpx;
			height: calc(100vh - 280rpx);
			overflow-x: hidden;

			.content-container {

				.title {
					height: 73rpx;
					line-height: 73rpx;
					background: #E1EAF4;
					display: flex;
					text-indent: 50rpx;
					font-size: 24rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #002B5B;
				}

				.addInspect {
					padding: 0 0 50rpx 0;

					.map {
						height: 80rpx;
						line-height: 80rpx;
						background: url('/static/img/map.png') no-repeat center center;
						background-size: cover;
						font-size: 23rpx;
						font-family: PingFangSC-Medium, PingFang SC;
						font-weight: 500;
						color: #002E63;
						margin: 0 auto;
						display: flex;
						align-items: center;

						image {
							width: 22rpx;
							height: 26rpx;
							margin: 0 11rpx 0 53rpx;
						}
					}

					.content {

						.text {
							font-size: 19rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #333333;
							margin: 0 auto 13rpx;
							height: 68rpx;
							line-height: 68rpx;
							display: flex;
							align-items: center;
							padding: 0 50rpx;
							background: #fff;

							text {
								color: #666666;
							}

							.uni-stat__select {
								width: 460rpx;

								/deep/.uni-select {
									border: none;
								}

								/deep/.uni-select__input-placeholder {
									font-size: 19rpx;
								}
							}

							.uni-date {
								width: 460rpx;

								/deep/.uni-date-editor--x {
									border: none;
								}
							}

							.custom-radio-group {
								display: flex;

								.labelRadio {
									display: flex;
									margin: 0 10rpx;
									align-items: center;
								}

								/deep/.uni-radio-input {
									width: 20rpx;
									height: 20rpx;
									border: 1rpx solid #979797;
								}

								.yes {

									/deep/.uni-radio-input {
										background: #07D276 !important;
										border-color: #07D276 !important;

										&::before {
											background: #07D276;
											border-radius: 50%;
											font-size: 16rpx;
										}
									}
								}

								.no {

									/deep/.uni-radio-input {
										background: #FF1F1F !important;
										border-color: #FF1F1F !important;
										position: relative;
										transform: rotate(45deg);

										&::before {
											content: "";
											position: absolute;
											top: 50%;
											left: 50%;
											background-color: #fff;
											width: 2rpx;
											height: 60%;
											transform: translate(-50%, -50%);
										}

										&::after {
											content: "";
											position: absolute;
											top: 50%;
											left: 50%;
											background-color: #fff;
											width: 60%;
											height: 2rpx;
											transform: translate(-50%, -50%);
										}
									}
								}
							}

							uni-navigator {
								display: flex;
								align-items: center;
								color: #0552A9;
							}

							&:nth-child(even) {
								background: #F9F9F9;
							}
						}

						.two {

							.box {

								.text {

									.input-container {

										input {
											font-size: 19rpx;
										}
									}
								}
							}

							.abnormal {

								.block {

									.text {

										.div {
											display: flex;
											flex-direction: column;
											line-height: initial;
										}
									}
								}
							}
						}

						.three {

							.box {

								.text {

									view {
										color: #1e4de6
									}
								}

								.facadePhoto {
									height: 150px;

									image {
										width: 100rpx;
										height: 100rpx;
									}
								}
							}
						}
					}
				}

				.addInspectContent {
					padding: 0 17.5rpx 300rpx 17.5rpx;

					.positioning {
						display: flex;
						align-items: center;
						height: 56rpx;
						line-height: 56rpx;
						background: #33B97C;
						box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
						border-radius: 28rpx;
						font-size: 23rpx;
						font-family: PingFangSC-Medium, PingFang SC;
						font-weight: 500;
						color: #FFFFFF;
						margin: 14rpx auto;

						image {
							width: 22rpx;
							height: 26rpx;
							margin: 0 11rpx 0 53rpx;
						}
					}

					.box {

						.dt {
							background: #FFFFFF;
							box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
							border-radius: 15rpx;
							padding: 23rpx 28rpx;
							position: fixed;
							width: 694rpx;
							left: 0rpx;
							bottom: 110rpx;
							;
							z-index: 2;

							.h1 {
								font-size: 24rpx;
								font-family: PingFangSC-Medium, PingFang SC;
								font-weight: 500;
								color: #0552A9;
								/* padding: 0 0 22rpx 0;
								border-bottom: 2rpx solid #CECECE; */
							}

							.div {
								display: flex;
								margin: 21rpx auto 0;

								.left {
									font-size: 20rpx;
									font-family: PingFangSC-Regular, PingFang SC;
									font-weight: 400;
									color: #3A3A3A;
								}

								.right {
									font-size: 20rpx;
									font-family: PingFangSC-Regular, PingFang SC;
									font-weight: 400;
									color: #686868;

									text {
										color: #DC0000;
									}

									input {
										font-size: 20rpx;
										font-family: PingFangSC-Regular, PingFang SC;
										font-weight: 400;
										color: #999999;
										width: 400rpx;
										text-indent: 10rpx;
									}

									.placeholder-class {
										color: #999999;
									}
								}

								&:last-child {
									align-items: center;
								}

								.custom-radio-group {
									display: flex;
									font-size: 20rpx;
									font-family: PingFangSC-Regular, PingFang SC;
									font-weight: 400;

									.labelRadio {
										display: flex;
										margin: 0 10rpx;
										align-items: center;
									}

									/deep/.uni-radio-input {
										width: 20rpx;
										height: 20rpx;
										border: 1rpx solid #979797;
									}

									.yes {

										/deep/.uni-radio-input {
											background: #07D276 !important;
											border-color: #07D276 !important;

											&::before {
												background: #07D276;
												border-radius: 50%;
												font-size: 16rpx;
											}
										}
									}

									.no {

										/deep/.uni-radio-input {
											background: #FF1F1F !important;
											border-color: #FF1F1F !important;
											position: relative;
											transform: rotate(45deg);

											&::before {
												content: "";
												position: absolute;
												top: 50%;
												left: 50%;
												background-color: #fff;
												width: 2rpx;
												height: 60%;
												transform: translate(-50%, -50%);
											}

											&::after {
												content: "";
												position: absolute;
												top: 50%;
												left: 50%;
												background-color: #fff;
												width: 60%;
												height: 2rpx;
												transform: translate(-50%, -50%);
											}
										}
									}
								}
							}
						}

						.dd {

							.h1 {
								font-size: 20rpx;
								font-family: PingFangSC-Regular, PingFang SC;
								font-weight: 400;
								color: #333333;
								margin: 10rpx auto;
								text-indent: 26rpx;
							}

							.block {
								background: #FFFFFF;
								box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
								border-radius: 15rpx;
								padding: 23rpx 26rpx;

								.li {

									.titles {
										font-size: 20rpx;
										font-family: PingFangSC-Medium, PingFang SC;
										font-weight: 500;
										color: #353535;
										position: relative;
										display: flex;
										flex-direction: row;
										align-items: flex-start;
										justify-content: space-between;


										.titles-left {
											width: 420rpx;
										}

										.titles-right {
											display: flex;
											flex-direction: row;
											align-items: flex-end;
											justify-content: flex-end;
											height: 30rpx;
											margin-top: 20rpx;
										}


										text {
											margin: 0 6rpx 0 0;
										}

										&.red {

											text {
												color: #EF0000;
											}
										}

										.guide {
											color: #026DC6;
											display: flex;
											align-items: center;
											margin-right: 10rpx;

											image {
												width: 22rpx;
												height: 22rpx;
												margin: 0 6rpx 0 0;
											}

											.triangle {
												width: 0;
												height: 0;
												border-top: 8rpx solid transparent;
												border-bottom: 8rpx solid transparent;
												border-left: 10rpx solid #026DC6;
												position: absolute;
												top: 50%;
												right: -20rpx;
												transform: translate(-50%, -50%);
											}
										}
									}

									.optionList {
										display: flex;
										flex-direction: column;
										margin: 10px auto 0;
										align-items: flex-end;

										.list {
											display: flex;

											.option {
												padding: 12rpx 30rpx;
												border: 2rpx solid #C3C3C3;
												border-radius: 5rpx 0 0 5rpx;
												font-size: 18rpx;
												font-family: PingFangSC-Regular, PingFang SC;
												font-weight: 400;
												color: #666666;

												&:nth-child(2) {
													border-left: none;
													// border-right: none;
													border-radius: 0;
												}

												&:last-child {
													border-radius: 0 5rpx 5rpx 0;
													border-left: 0;
												}

												&.active {
													background: #E9F2FF;
													color: #0552A9;
												}
											}
										}

										.case {
											// width: 650rpx;
											width: 100%;

											.h2 {
												font-size: 16rpx;
												font-family: PingFangSC-Medium, PingFang SC;
												font-weight: 500;
												color: #353535;
												margin: 20rpx 0 6rpx 0;
											}

											input {
												margin: 20rpx auto;
												border: 2rpx solid #e5e5e5;
												// border: 2rpx solid red;
												border-radius: 6rpx;
												text-indent: 10rpx;
												font-size: 18rpx;
												padding: 16rpx 0;

												&.inspect {
													border: 2rpx solid yellow;
												}
											}

											.placeholder-class {
												color: red;
											}

											.placeholder-class-inspect {
												color: yellow;
											}
										}
									}

									&+.li {
										margin: 20rpx auto 0;

										.title {

											// text {
											// 	color: #353535;
											// }
										}
									}
								}
							}
						}
					}
				}

				.addInspectTrisk {
					padding: 0 17.5rpx;

					.positioning {
						display: flex;
						align-items: center;
						height: 56rpx;
						line-height: 56rpx;
						background: #33B97C;
						box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
						border-radius: 28rpx;
						font-size: 23rpx;
						font-family: PingFangSC-Medium, PingFang SC;
						font-weight: 500;
						color: #FFFFFF;
						margin: 14rpx auto;

						image {
							width: 22rpx;
							height: 26rpx;
							margin: 0 11rpx 0 53rpx;
						}
					}

					.box {
						border-top: 2rpx solid #D6D6D6;

						.div {
							display: flex;
							align-items: center;
							justify-content: flex-start;
							height: 68rpx;
							line-height: 68rpx;
							font-size: 21rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #333333;
							border-left: 2rpx solid #D6D6D6;
							border-right: 2rpx solid #D6D6D6;
							border-bottom: 2rpx solid #D6D6D6;

							.title {
								width: 199rpx;
								text-indent: 45rpx;
								border-right: 2rpx solid #D6D6D6;
							}

							.titles {
								width: 199rpx;
								text-indent: 45rpx;
								border-right: 2rpx solid #D6D6D6;
							}

							.state {
								width: 307rpx;
								text-align: left;
								text-indent: 88rpx;
								border-right: 2rpx solid #D6D6D6;
								display: flex;
								align-items: center;

								.yes {
									color: #333333;
								}

								.no {
									color: #FF2A2A;

									image {
										width: 21rpx;
										height: 21rpx;
										margin: 0 0 0 10rpx;
									}
								}
							}

							.details {
								width: 206rpx;
								height: 100%;
								text-align: center;
								color: #0552A9;
							}

							&:nth-child(even) {
								background: #F9F9F9;
							}
						}

						.determine {
							display: none;
							width: 80%;
							margin: 30rpx auto 0;
							height: 55rpx;
							line-height: 55rpx;
							background: #0552A9;
							border-radius: 10rpx;
							font-size: 20rpx;
							font-family: PingFangSC-Regular, PingFang SC;
							font-weight: 400;
							color: #fff;
							text-align: center;
						}

						.illustrate {
							padding: 16rpx 24rpx;

							.titles {
								font-size: 20rpx;
								font-family: PingFangSC-Medium, PingFang SC;
								font-weight: 500;
								color: #333333;
							}

							.content {
								font-size: 20rpx;
								padding-bottom: 20px;
								color: #666666;
							}
						}
					}
				}
			}

			.fixed {
				position: fixed;
				left: 0;
				bottom: 0;
				height: 92rpx;
				background: #fff;
				padding: 0 95rpx 24rpx 95rpx;
				margin: 0 auto;
				display: flex;
				align-items: center;
				width: calc(100% - 190rpx);

				button {
					width: 269rpx;
					height: 55rpx;
					line-height: 55rpx;
					background: #0552A9;
					border-radius: 10rpx;
					font-size: 20rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;

					&.determine {
						color: #fff;
					}

					&.cancellation {
						background: none;
						border: 1rpx solid #979797;
						color: #979797;
					}
				}
			}
		}

		.facadePhotoPopupContent,
		.noticeFormPopupContent,
		.riskReminderDetailsContent,
		.taskAssociationContent,
		.riskWarningPopupContent,
		.inspectionGuidelinesContent {
			background: #FFFFFF;
			border-radius: 20rpx 20rpx 0 0;

			.title {
				width: 100%;
				height: 80rpx;
				line-height: 80rpx;
				background: url('/static/img/popupTitle.png') no-repeat center center;
				background-size: cover;
				font-size: 25rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				// text-indent: 45rpx;
				text-align: center;
			}

			.box {
				padding: 45rpx 30rpx;

				.image-list {
					display: flex;
					flex-wrap: wrap;
					justify-content: flex-start;

					.image-item {
						position: relative;
						width: 212rpx;
						height: 212rpx;
						overflow: hidden;
						border-radius: 20rpx;
						margin: 0 25rpx 25rpx 0;

						&:nth-child(3n) {
							margin: 0 0 25rpx 0;
						}

						.itemImg {
							width: 100%;
							border-radius: 20rpx;
						}

						.delete {
							position: absolute;
							top: 16rpx;
							right: 16rpx;
							width: 20rpx;
							height: 20rpx;
						}
					}

					.upload {
						width: 212rpx;
						height: 212rpx;
						background: url('/static/img/upload.png') no-repeat center center;
						background-size: cover;
						padding: 0;
						margin: 0;
					}

				}

				.div {
					display: flex;
					align-items: center;
					justify-content: flex-start;
					height: 68rpx;
					line-height: 68rpx;
					font-size: 21rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
					border-bottom: 2rpx solid #D6D6D6;

					.titles {
						width: 199rpx;
						text-indent: 45rpx;
						border-right: 2rpx solid #D6D6D6;
					}

					.state {
						width: 307rpx;
						text-align: left;
						text-indent: 88rpx;
						border-right: 2rpx solid #D6D6D6;
						display: flex;
						align-items: center;

						.yes {
							color: #333333;
						}

						.no {
							color: #FF2A2A;

							image {
								width: 21rpx;
								height: 21rpx;
								margin: 0 0 0 10rpx;
							}
						}
					}

					.details {
						width: 206rpx;
						height: 100%;
						text-align: center;
						color: #0552A9;
					}

					&:nth-child(even) {
						background: #F9F9F9;
					}
				}

				.dt {
					font-size: 20rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #FF4242;
					text-align: center;
					margin: 26rpx auto 0;
				}

				.dd {
					display: flex;
					align-items: center;
					border-bottom: 2rpx solid #D6D6D6;
					font-size: 21rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
					border-top: 2rpx solid #D6D6D6;
					border-left: 2rpx solid #D6D6D6;
					border-right: 2rpx solid #D6D6D6;

					/deep/.uni-checkbox-input {
						width: 20rpx;
						height: 20rpx;
						margin: 0 12.5rpx 0 32rpx;
						border-radius: 0;
						border-color: #0552A9;
					}

					/deep/.uni-checkbox-input-checked {
						background: #0552A9;

						&::before {
							color: #fff;
							font-size: 16rpx;
						}
					}

					>view {

						&:nth-child(1) {
							width: 95rpx;
							height: 68rpx;
							line-height: 68rpx;
							text-align: center;
							border-right: 2rpx solid #D6D6D6;
						}

						&:nth-child(2) {
							width: 410rpx;
							height: 68rpx;
							line-height: 68rpx;
							text-align: left;
							border-right: 2rpx solid #D6D6D6;
							text-indent: 2em;
						}

						&:nth-child(3) {}
					}

					&+.dd {
						border-top: none;
					}
				}
			}

			.button {
				margin: 58rpx auto 0;
				padding: 0 95rpx 24rpx 95rpx;
				display: flex;

				button {
					width: 269rpx;
					height: 55rpx;
					line-height: 55rpx;
					background: #0552A9;
					border-radius: 10rpx;
					font-size: 20rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;

					&.determine {
						color: #fff;
					}

					&.cancellation {
						background: none;
						border: 1rpx solid #979797;
						color: #979797;
					}
				}
			}
		}

		.noticeFormPopupContent {

			.h1Title {
				font-size: 26rpx;
				margin: 20rpx auto 0;
				text-align: center;
			}

			.h2Ttitle {
				font-size: 30rpx;
				text-align: center;
			}

			.box {
				padding: 45rpx 30rpx;
				height: 400px;
				overflow-x: hidden;

				.div {
					border-top: 2rpx solid #D6D6D6;
					border-left: 2rpx solid #D6D6D6;
					border-right: 2rpx solid #D6D6D6;
					line-height: initial;
					height: initial;
					min-height: 82rpx;
					position: relative;

					&::before {
						content: "";
						display: block;
						width: 2rpx;
						height: 100%;
						background: #D6D6D6;
						position: absolute;
						top: 50%;
						left: 229rpx;
						transform: translate(-50%, -50%);
					}

					.titles {
						width: 229rpx;
						line-height: 1.2;
						height: 100%;
						display: flex;
						flex-direction: column;
						justify-content: center;
						margin: 0 20rpx 0 0;
						border-right: 0;
					}

					.textarea {
						width: 50%;
						padding: 10rpx 0;
					}

					input {
						font-size: 21rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						width: 460rpx;
						text-indent: 20rpx;
					}

					.value {
						font-size: 21rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						width: 460rpx;
						text-indent: 20rpx;
					}

					.placeholder-class {
						color: #999999;
					}

					.uni-stat__select {
						width: 460rpx;

						/deep/.uni-select {
							border: none;
						}
					}

					.uni-date {
						width: 460rpx;

						/deep/.uni-date-editor--x {
							border: none;
						}
					}

					&+.div {
						border-top: none;
					}
				}
			}
		}

		.riskReminderDetailsContent {

			.illustrate {

				.titles {
					font-size: 20rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #333333;
				}

				.content {
					font-size: 20rpx;
					color: #666666;
					padding: 10px 0px
				}
			}

			.button {
				margin: 58rpx auto 0;
				padding: 0 95rpx 24rpx 95rpx;
				display: flex;

				button {
					width: 269rpx;
					height: 55rpx;
					line-height: 55rpx;
					background: #0552A9;
					border-radius: 10rpx;
					font-size: 20rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;

					&.determine {
						color: #fff;
					}

					&.cancellation {
						background: none;
						border: 1rpx solid #979797;
						color: #979797;
					}
				}
			}

			.closeReturn {
				width: 80%;
				margin: 30rpx auto 0;
				height: 55rpx;
				line-height: 55rpx;
				background: #0552A9;
				border-radius: 10rpx;
				font-size: 20rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #fff;
				text-align: center;
				position: relative;
				top: -30rpx;
			}
		}

		.riskWarningPopupContent {

			.box {
				height: 60vh;
				overflow-x: hidden;

				.div {
					border-top: 2rpx solid #D6D6D6;
					border-left: 2rpx solid #D6D6D6;
					border-right: 2rpx solid #D6D6D6;

					&+.div {
						border-top: none;
					}
				}

				.illustrate {
					padding: 16rpx 24rpx;

					.titles {
						font-size: 20rpx;
						font-family: PingFangSC-Medium, PingFang SC;
						font-weight: 500;
						color: #333333;
					}

					.content {
						font-size: 20rpx;
						color: #666666;
					}
				}

				.determine {
					width: 80%;
					margin: 30rpx auto 0;
					height: 55rpx;
					line-height: 55rpx;
					background: #0552A9;
					border-radius: 10rpx;
					font-size: 20rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #fff;
					text-align: center;
				}
			}
		}

		.inspectionGuidelinesContent {

			.box {

				.div {

					border-top: 2rpx solid #D6D6D6;
					border-left: 2rpx solid #D6D6D6;
					border-right: 2rpx solid #D6D6D6;

					&+.div {
						border-top: none;
					}

					.contents {
						text-indent: 20rpx;
					}
				}

				.closeReturn {
					width: 80%;
					margin: 30rpx auto 0;
					height: 55rpx;
					line-height: 55rpx;
					background: #0552A9;
					border-radius: 10rpx;
					font-size: 20rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #fff;
					text-align: center;
				}
			}
		}
	}

	.no-realy-content {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		// width: 650rpx;
		width: 100%;
	}

	.uni-select__input-text {
		font-size: 18rpx;
	}

	.content-upload-btn {
		margin-left: 20px;
		border: 0px;
		border-radius: 7px;
		background-color: #e3b339;
		color: #ffffff;
		padding: 6px 15px;
		font-size: 20rpx;
	}

	.content-upload-btn-realy {
		background-color: #1da247;
		margin-left: 20px;
		border: 0px;
		border-radius: 7px;
		color: #ffffff;
		padding: 6px 15px;
		font-size: 20rpx;
	}

	.upload-btn {
		width: 76px;
		height: 32px;
		border-radius: 7px;
		background-color: #026DC6;
		color: #ffffff;
		font-size: 11px;
	}


	.popupContent,
	.popupContentTwo {
		background: #FFFFFF;
		border-radius: 20rpx 20rpx 0 0;

		.title {
			width: 100%;
			height: 80rpx;
			line-height: 80rpx;
			background: url('/static/img/popupTitle.png') no-repeat center center;
			background-size: cover;
			font-size: 25rpx;
			font-family: PingFangSC-Medium, PingFang SC;
			font-weight: 500;
			color: #FFFFFF;
			// text-indent: 45rpx;
			text-align: center;
		}

		.box {
			text-align: center;
			margin: 50rpx auto;
		}

		.button {
			margin: 58rpx auto 0;
			display: flex;
			justify-content: space-around;
			align-items: center;

			button {
				width: 269rpx;
				height: 55rpx;
				line-height: 55rpx;
				background: #0552A9;
				border-radius: 10rpx;
				font-size: 20rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;

				&.determine {
					color: #fff;
				}

				&.cancellation {
					background: none;
					border: 1rpx solid #979797;
					color: #979797;
				}
			}
		}
	}

	.sig-image {
		width: 100px;
		height: 50px;
		margin-left: 20px;
	}

	.item-text {
		line-height: 30px;
	}

	.box-item {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-start;
		padding: 0px 14px;

	}

	.box-item-left {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: flex-start;
	}

	.btna {
		font-size: 16px;
		color: #0055ff;

	}

	.location-status {
		font-size: 16px;
		color: #07D276;
		text-align: center;
	}

	.location-active {
		font-size: 16px;
		color: #d22741;
		text-align: center;
	}

	.manage_status_box {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
		border-radius: 15rpx;
		padding: 23rpx 28rpx;
		margin-bottom: 20rpx;

	}

	.custom-radio-group {
		display: flex;

		.labelRadio {
			display: flex;
			margin: 0 10rpx;
			align-items: center;
		}

		/deep/.uni-radio-input {
			width: 20rpx;
			height: 20rpx;
			border: 1rpx solid #979797;
		}

		.yes {

			/deep/.uni-radio-input {
				background: #07D276 !important;
				border-color: #07D276 !important;

				&::before {
					background: #07D276;
					border-radius: 50%;
					font-size: 16rpx;
				}
			}
		}

		.no {

			/deep/.uni-radio-input {
				background: #FF1F1F !important;
				border-color: #FF1F1F !important;
				position: relative;
				transform: rotate(45deg);

				&::before {
					content: "";
					position: absolute;
					top: 50%;
					left: 50%;
					background-color: #fff;
					width: 2rpx;
					height: 60%;
					transform: translate(-50%, -50%);
				}

				&::after {
					content: "";
					position: absolute;
					top: 50%;
					left: 50%;
					background-color: #fff;
					width: 60%;
					height: 2rpx;
					transform: translate(-50%, -50%);
				}
			}
		}
	}

	.abnormal {
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
		border-radius: 15rpx;
		padding: 23rpx 28rpx;
		margin-bottom: 20rpx;


		.block {
			.text {
				display: flex;
				flex-direction: row;
				justify-items: flex-start;
				align-items: center;
				padding: 23rpx 0rpx;

				.div {
					display: flex;
					flex-direction: column;
					line-height: initial;
				}
			}
		}
	}

	.three {
		background: #FFFFFF;
		box-shadow: 0rpx 0rpx 29rpx 0rpx rgba(0, 0, 0, 0.05);
		border-radius: 15rpx;
		padding: 23rpx 28rpx;
		margin-bottom: 20rpx;

		.box {

			.text {
				display: flex;
				flex-direction: row;
				align-items: flex-start;
				justify-content: flex-start;

				view {
					color: #1e4de6
				}
			}

			.facadePhoto {
				height: 150px;

				image {
					width: 100rpx;
					height: 100rpx;
				}
			}
		}
	}

	.text-red {
		color: #e11515;
	}

	.float-border {
		// border:1px solid red;
		padding: 20rpx;
		// overflow: hidden;
		box-shadow: 0px 0px 15rpx 6rpx rgba(147, 142, 213, 0.5);
		transition: box-shadow 0.3s ease;
		border-radius: 10rpx;
	}

	.problem {
		width: 100%;
		border: 1px solid #D6D6D6;
		margin-top: 10px;
	}
</style>